<!DOCTYPE html>
<html>
    <head>
        <title>判断页面是有添加了W3C声明</title>
        <script LANGUAGE="JavaScript">
            if ( document.compatMode=="CSS1Compat" )
                alert("本文档添加了W3C的声明")
            else
                alert("本文档未添加W3C的声明")
        </script>
    </head>
    <body>
    </body>
</html>
